Repository navigation
D155 slice 3: corpus publication - #607
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements D155 slice 3's document-folder publication capability and the design owner's accepted lock-loss and scaling decisions. Ordinary publication uses the existing work ledger; profile activation stays in slice 4.
The P1 scaling finding is fixed:
publish_corpusno longer discovers the whole store or renders/HEAD-checks the whole navigation tree. Migrationp9_51_0072adds nullabledocuments.corpus_paths text[], the small set of possibly written document folders. The publisher commits the old-plus-desired path set on its advisory-lock session before object IO, lists only recorded document prefixes, writes the desired folder, removes old folders, and repairs only their ancestor indexes/radix pages plus rootllms.txt. Old paths survive until navigation succeeds, including a crash after the last old-folder object deletion, then collapse to the desired path (or null after removal). Navigation membership/counts stream from current DB selections; unrelated branches are not rendered. A fresh tree initializes the fixed eleven type indexes once.Radix pages now occupy a reserved
~/subtree beneath their index, allowing bounded cleanup of obsolete pages without listing sibling document folders. The P3 builder policy advances top3-reader-2026.11c:d155; this rekeys P3 exports only. No converter, extraction, Claimify, embedding, summary, or text-origin reuse boundary changes (Rule 4).Full reconcile retains one full-store scan, unions discovered and recorded paths, repairs
corpus_pathsfor served/unselected documents, and rebuilds all navigation. The deterministic suffix remains the repair/forget/restore and human lookup mechanism. D155, E0 §§5–7, the schema design, analysis and delivery plan state this contract; the former all-navigation implementation exception is removed.Every provider mutation still checks the deployment advisory lock on its original PostgreSQL session and the live work claim. Finite S3 connect/read timeouts, disabled automatic SDK retries, bounded multipart units, streamed input verification and expected SHA-256 metadata remain. An already-issued request can still land after session loss and a newer publication: the marker means current inputs were published once. Digest-verifying reconcile repairs missing/mismatching metadata even behind a matching marker. This accepted rare transient staleness is unchanged; no fencing, receipt, journal or membership table was added.
Implementation
publish_corpuswork and freshcorpus_publicationevent targets withdoc_id-only payloads. Served reading/structure and canonical title/MIME changes invalidate and enqueue in authoritative transactions. Current-policy seeding, stale-policy rejection, class claims and pushedrun_taskuse existing leases/retries/DLQ/announcements.Verification
All requested local checks passed on Python 3.13, with no hosted model calls:
text[]cleanup paths. Both expected failures are the existing D122 previous-eight-Selection Claimify-window gap, for ordinary ingestion and backfill; paid-work reuse identities are unchanged.git diff --checkpassed.Only this job used the configured shared test database, and all DB suites ran sequentially. Real MinIO was started with
.github/ci/start-minio.sh.Scope
Profiles remain unactivated. Delete/forget/restore integration, marker-based serving/readiness, periodic digest verification and provider qualification beyond MinIO remain in their planned slices. The full-store scan remains mandatory for forget/restore repair of independently restored objects. PR #607 stays draft and must not be merged as profile activation. Remote CI for the latest pushed commit is still running; the local checks above are complete.
Contributor agreement
Signing on behalf of a legal entity (leave blank if accepting individually):